/*
* Poppy Game Engine - https://pgetemplate.googlecode.com/svn/
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* Copyright (c) 2008 Poppy
*/

#pragma once

#include "SystemExportSymbol.h"

#ifndef _MSC_VER
#include <cstddef>
#endif

#ifdef _DEBUG
#define PGE_USING_MEMORY_POOL
#endif

#ifdef PGE_USING_MEMORY_POOL
#define PGE_MEMORY_DEBUG
#endif

namespace PGESystem
{

	class PGESYSTEM_API CMemObject
	{

	public:

		#ifdef PGE_MEMORY_DEBUG
		void * operator new(size_t size, const char * file, int line, const char * function);
		void * operator new[](size_t size, const char * file, int line, const char * function);
		void operator delete(void * pointer, const char * file, int line, const char * function);
		void operator delete[](void * pointer, const char * file, int line, const char * function);
		#else
		void * operator new(size_t size);
		void * operator new[](size_t size);
		#endif

		void operator delete(void * pointer);
		void operator delete[](void * pointer);

	};

}



#ifdef PGE_MEMORY_DEBUG
#define PGENew new(__FILE__, __LINE__, __FUNCTION__)
#define PGEDelete delete
#else
#define PGENew new
#define PGEDelete delete
#endif
